<template>
    <div>
        <p>我是兄弟组件</p>
        <p><button @click="btn">接受兄弟传来的值</button></p>
        <p>{{ str }}</p>
    </div>
</template>

<script>
import eventbus from '../utils/eventBus.js'
export default {
    name: 'ZyhProjectBorther',

    data() {
        return {
            str: ''
        };
    },

    mounted() {

    },

    methods: {
        btn() {
            eventbus.$on('bortherGive', data => {
                console.log(data);
                this.str = data
            })
        }
    },
};
</script>